Skip to content

fix(i18n): correct Bulgarian grammar for status labels - #127

Merged
katsar0v merged 1 commit into
mainfrom
fix/bulgarian-status-grammar
Jul 28, 2026
Merged

fix(i18n): correct Bulgarian grammar for status labels#127
katsar0v merged 1 commit into
mainfrom
fix/bulgarian-status-grammar

Conversation

@katsar0v

Copy link
Copy Markdown
Owner

Problem

In the campaign queue, the Статус column mixed grammatical forms: one campaign showed as Завършена (feminine singular, agreeing with кампания) while the next showed Отменени (plural).

The cause is not a typo. A single msgid — Cancelled, Completed, Pending, Sent, Scheduled, One-time, Active, … — is reused for two different jobs:

  • the badge on one row ("this campaign is cancelled") → singular, and gendered by the noun it describes: кампания is feminine, имейл and абонат are masculine;
  • the filter link / stat card ("Отменени (3)") → plural.

English doesn't inflect, so one string covers both. Bulgarian (and German, for the date columns) cannot. Whichever form the translator picked was wrong in the other place.

Fix

Every string that labels a single item now carries a gettext context via _x(), so each role can be translated independently. Plain __() stays with the filter links and stat cards, and is now consistently plural in Bulgarian.

Context Used by Bulgarian
campaign status campaign badge, queue + campaign detail Чакаща, В процес, Завършена, Отменена, Насрочена (feminine singular)
email status per-recipient badge, campaign detail + legacy queue Чакащ, Изпратен, Неуспешен, Отменен, Насрочен (masculine singular)
subscriber status subscriber badge, edit form select, bulk-edit JS Активен, Неактивен, Отписан
campaign type one-time badge Еднократна
cron status dashboard cron box Активен / Неактивен
table column header Sent / Opened / Scheduled date columns Изпратен на, Отворен на, Насрочен за
(no context) filter links, stat cards Чакащи, Изпратени, Неуспешни, Отменени, Завършени, Насрочени, Активни, Отписани

German gets the same contexts with its existing wording, plus proper date-column headers (Gesendet am, Geöffnet am, Geplant für) — without the contexts those msgids would have fallen back to untranslated English.

.pot, bg_BG.po and de_DE.po were hand-edited (not regenerated, which drops translations) and the .mo files recompiled with wp i18n make-mo, byte-identical to what the Translations workflow produces.

Testing

  • composer test — 274 passing (269 existing + 5 new)
  • composer phpcs — clean
  • New tests/Unit/class-statustranslationstest.php scans the source for _x()/esc_html_x()/esc_attr_x() calls and fails if any context is missing or untranslated in the .pot, bg_BG.po or de_DE.po, so a future context can't silently ship as English. It also pins the Bulgarian singular badge forms and the plural filter forms against each other.
  • tests/Unit/class-testcase.php gained stubs for _x(), esc_html_x() and esc_attr_x().

Notes

No behaviour, markup or CSS class changes — only which translation function supplies each label.

🤖 Generated with Claude Code

…rrectly

The queue rendered a single campaign's status as "Завършена" (feminine
singular) right next to "Отменени" (plural), because the same msgid served
both the badge on one row and the filter links that count many items.
Bulgarian and German inflect those two roles differently, so one translation
cannot be right for both.

Badges, type labels and select options that describe a single item now use
_x() with a context ("campaign status", "email status", "campaign type",
"subscriber status", "cron status", "table column header"); the plain strings
stay with the filter links and stat cards and are now consistently plural in
Bulgarian.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@katsar0v
katsar0v merged commit 2e65ae6 into main Jul 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant